package com.itheima.d16_innerClassanonymous;

public class Test{
    public static void main(String[] args) {
        Animal dog = new Dog();
        dog.run();


        //匿名内部怎么写
        Animal animal = new Animal() {

            @Override
            public void run() {
                System.out.println("狗跑");
            }
        };
        animal.run();
    }
}


abstract class Animal {
    public abstract void run();
}

class Dog extends Animal{
    @Override
    public void run() {
        System.out.println("狗跑");
    }
}
